<%@ Page language="c#" Codebehind="DataSource.aspx.cs" AutoEventWireup="True" Inherits="CrossFactory.SiteNote.XmlEditor.DataSource" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>
			<%= pageResourceManager.GetString("pagetitle")%>
		</title>
		<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
		<meta name="CODE_LANGUAGE" Content="C#">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
		<LINK href="StyleSheets/XmlEditor.css" type="text/css" rel="stylesheet">
		<script language="javascript">
			var currentDataSource;
			var hyperlink;
			var dialog = null;
			
			function Loaded()
			{
				var oOption;
				
				bClosing = false;
				window.returnValue = false;

				currentDataSource = dialogArguments;
				
				UpdateView();
			}
			
			function UpdateView()
			{
				var html = '<table>';
				
				html += '<tr><td class="value">Provider</td><td class="value"><input type="text" name="datasource_' + 0 + '" value="' + currentDataSource[0] + '" /></td></tr>';
				html += '<tr><td class="value">CachingName</td><td class="value"><input type="text" name="datasource_' + 1 + '" value="' + currentDataSource[1] + '" /></td></tr>';
				html += '<tr><td class="value">Select</td><td class="value"><TEXTAREA name="datasource_' + 2 + '"  rows="10" cols="50">' + currentDataSource[2].replace(/'/g, "\'") + '</TEXTAREA></td></tr>';
				html += '<tr><td class="value">ParameterName</td><td class="value"><input type="text" name="datasource_' + 3 + '" value="' + currentDataSource[3] + '" /></td></tr>';
				html += '<tr><td class="value">ParameterType</td><td class="value"><input type="text" name="datasource_' + 4 + '" value="' + currentDataSource[4] + '" /></td></tr>';
				html += '<tr><td class="value">Parametervalue</td><td class="value"><input type="text" name="datasource_' + 5 + '" value="' + currentDataSource[5] + '" /></td></tr>';
				html += '<tr><td class="value">Display Column</td><td class="value"><input type="text" name="datasource_' + 6 + '" value="' + currentDataSource[6] + '" /></td></tr>';
				html += '<tr><td class="value">Data Column</td><td class="value"><input type="text" name="datasource_' + 8 + '" value="' + currentDataSource[8] + '" /></td></tr>';
				html += '<tr><td class="value">Filter</td><td class="value"><input type="text" name="datasource_' + 7 + '" value="' + currentDataSource[7] + '" /></td></tr>';
								
				html += '</table>';
				
				document.all['td_datasource'].innerHTML = html;	
			}	
			
			function UnLoading()
			{
				bClosing = true;
  			}
  			
  			function Remove(pos)
  			{
  				SaveItems();
  				currentItems.splice(pos,1);
  				UpdateView();
  			}
  			  						
			function SaveItems()
			{
				for(i = 0; i < currentDataSource.length; i++)
				{
					id = 'datasource_' + i;
					currentDataSource[i] = document.all[id].value
				}	
			}
			
  					
			function Close()
			{
				window.close();
			}
			
			function Save()
			{
				SaveItems();
				window.returnValue = true; 
				
				window.close();
			}

		</script>
	</HEAD>
	<body MS_POSITIONING="FlowLayout" bottommargin="0" leftmargin="0" rightmargin="0" topmargin="0" onload="Loaded()" onunload="UnLoading()">
		<form id="Upload" method="post" runat="server" onsubmit="return Submitting();" encType="multipart/form-data">
			<table id="Main" cellSpacing="0" cellPadding="0" border="0" style="WIDTH:100%;HEIGHT:100%">
				<tr height="31">
					<td colspan="5">
						<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
							<tr>
								<td width="100%">
									<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
										<tr>
											<td width="100%" background="Images/HeaderLeft.gif"><img src="Images/Transp.gif" height="1" width="100%"></td>
											<td align="right"><img src="Images/HeaderRight.gif"></td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td width="7" background="Images/BackgroundLeft.gif"><img src="Images/Transp.gif" width="7"></td>
					<td width="7"><img src="Images/Transp.gif" width="7"></td>
					<td id="content" width="100%" height="100%" style="PADDING-BOTTOM:7px" class="label" valign="middle" align="center">
						<table id="UploadTable" runat="server" border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
							<tr>
								<td class="value" width="100%" height="310">
									<div style="height:310px;overflow-y:scroll;" id="td_datasource">
									</div>
								</td>
							</tr>
						</table>
						<asp:Label ID="Message" Runat="server"></asp:Label>
					</td>
					<td width="7"><img src="Images/Transp.gif" width="7"></td>
					<td width="9" height="100%">
						<table border="0" cellpadding="0" cellspacing="0" width="9" height="100%">
							<tr height="32">
								<td width="9"><img src="Images/BackgroundTopRight.gif"></td>
							</tr>
							<tr height="100%">
								<td width="9" background="Images/BackgroundRight.gif"></td>
							</tr>
						</table>
					</td>
				</tr>
				<tr height="40">
					<td colspan="5">
						<table border="0" cellpadding="0" cellspacing="0" height="100%">
							<tr>
								<td height="8"><img src="Images/FooterLeft.gif"></td>
								<td width="100%">
									<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
										<tr>
											<td width="100%" background="Images/FooterCenter.gif" height="8"></td>
											<td height="8"><img src="Images/FooterRight.gif" width="255" height="8"></td>
										</tr>
									</table>
								</td>
							</tr>
							<tr>
								<td align="right" width="100%" colSpan="3">
									<table id="Table5" width="100%" height="100%" border="0" style="BACKGROUND :url(Images/Footer.gif) no-repeat right 50%">
										<tr>
											<td width="100%"></td>
											<td><input id="save" type=button name="Save" value="Save" onclick="window.Save();"/></td>
											<td><input id="Cancel" type="button" name="Close" value='<%= pageResourceManager.GetString("cancelButton")%>' onclick="window.Close();"></td>
											<td width="1"></td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</form>
	</body>
</HTML>
